<?php
if(isset ($_POST['save_gadget']))
{
	$user_id= $_SESSION['tcADMINID'];
    $title = $_POST['title'];
	$desc = mysql_escape_string($_POST['maincont']);
	$stat = $_POST['authorised'];
	$file=gmdate('YmdHis').$_FILES["upload"]["name"] ;
     move_uploaded_file($_FILES["upload"]["tmp_name"],"../uploads/gadget_images/".$file);
			mysql_query("insert into gadget(gadget_name,gadget_desc,gadget_image,active_status,created_datetime) values ('$title', '$desc','".$file."','$stat', now() )");
			
		
			echo "<script>window.location='index.php?tc=gadget_add&_e=2'</script>";
	}
	else
	{
		//header("location:index.php?tc=picture_add&_e=1");	
		echo "<script>window.location='index.php?tc=gadget_add&_e=1'</script>";
	}	

?>